package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.pay.IPayContract;
import com.feihong.txgw.json.pay.JiFenParser;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName PayMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/4 18:30
 * @Describe
 * @Change
 */
public class PayMainModel implements IPayContract.IPayMainModel {

    public static PayMainModel create(){
        return new PayMainModel();
    }

    @Override
    public Observable<JiFenParser> getOrderJiFenInfo(String orderSn, String orderType) {
        return RetrofitManager.getInstance().getOrderJifenInfo(orderSn,orderType).compose(RxHelper.<JiFenParser>rxSchedulerHelper());
    }

    @Override
    public Observable<String> createWechatPayOrder(String orderID, String price, String handle_notify, String use_point, String payType, String orderName) {
        return RetrofitManager.getInstance().createWechatPayOrder(orderID,price,orderName,handle_notify,use_point,payType).compose(RxHelper.<String>rxSchedulerHelper());
    }
}
